#pragma once

#include <gofcl_usart_r.h>

typedef struct {
	u32_s SBKCMD : 1;
	u32_s RWU : 1;
	u32_s REN : 1;
	u32_s TEN : 1;
	u32_s IDLEIE : 1;
	u32_s RBNEIE : 1;
	u32_s TCIE : 1;
	u32_s TBEIE : 1;
	u32_s PERRIE : 1;
	u32_s PM : 1;
	u32_s PCEN : 1;
	u32_s WM : 1;
	u32_s WL : 1;
	u32_s UEN : 1;
	u32_s : 18;
} usart_ctl0_s;

_Static_assert(sizeof(usart_ctl0_s) == 4, "Struct usart_ctl0_s defined error!");

static inline void usart_wreg_ctl0_s(usart_qe usart_q, usart_ctl0_s ctl0) {
	union {
		usart_ctl0_s c;
		u32_s u;
	} cu = {
		.c = ctl0,
	};
	usart_wreg(usart_q, USART_CTL0_R, cu.u);
}
